package com.yunyi.user.response;

import com.yunyi.response.ResultCode;
import lombok.ToString;

/**
 * @ClassName UserCode
 * @Description TODO
 * @Author leizhang
 * Date 2021/8/21 9:50 下午
 * @Version 1.0
 **/
@ToString
public enum UserCode implements ResultCode {
    INVALIDPARAM(false,10003,"参数不合法"),
    ORDER_SAVE_FAIL(false,100021,"报名时间已截止"),
    ORDER_FAIL(false,100032,"订单取消失败,18:00之后不可取消订单"),
    ORDER_SUCCESS(true,100032,"订单取消成功！"),
    ORDER_CANCEL_FAIL(false,100032,"订单取消失败！"),
    No_APPOINTMENT(false,10004,"没有提前预约或签到时间错误");
    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;
    private UserCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
    @Override
    public boolean success() {
        return success;
    }
    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
